<%
  #File :   /app/views/jobs/list.rhtml
  #Author:  Andrew Stone
  #Created: 08.07.2006
%> 
<%=start_large_div_wrapper%>
  <div id="page_title">Listing Jobs</div>
  <div id="large">
    <table>
      <thead>
        <tr>
          <td>Title</td>
          <td>Location</td>
          <td>Actions</td>
        </tr>
      </thead>
      <tbody>
      <%
        if @jobs.length == 0 %>
          <tr>
            <td class = "nodata" colspan="2">No Jobs Found</td>
         </tr>
      <%
        else
          i = 0
          @jobs.each do |jb|
            bg = row_class(i)
            i += 1
      %>
            <tr class="<%=bg%>">
              <td><%=h(jb.title)%></td>
              <td><%=h(jb.location)%></td>
              <td class="action">
                <%
                  links = []
                  links << secure_link_to("Update", ca("/jobs","update", jb.id))
                  links << secure_link_to("Show", ca("/jobs","show", jb.id))
                  links << secure_link_to("Copy", ca("/jobs","create", jb.id))
                  if jb.enabled
                    links << secure_link_to("Disable", ca("/jobs","disable", jb.id), :confirm => "Are you sure?")
                  else
                    links << secure_link_to("Enable", ca("/jobs","enable", jb.id), :confirm => "Are you sure?")
                  end
                %>
                <%=secure_links(links)%>
              </td>
            </tr>
      <% 
          end
        end %>
      </tbody>
    </table>
    <div id="actions">
        <%=secure_link_to("Create Job",{:controller => "/jobs", :action => "create"})%>
    </div>
  </div>
<%=end_div_wrapper%>
